﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace GradeService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IGradeService
    {
        /// <summary>
        /// Get a gradebook for a user by username for the requested semester
        /// </summary>
        /// <param name="username">Encrypted username</param>
        /// <param name="semester_code">Semester code ex F2011 for fall 2011</param>
        /// <returns>Grade book for the username for the requested semester</returns>
        public GradeBook getGradeBookByUsername(String username, String semester_code)
        {
            GradeBook gradebook = new GradeBook();

            return gradebook;
        }

        /// <summary>
        /// Get a gradebook for a user by id for the requested semester
        /// </summary>
        /// <param name="username">Encrypted user id</param>
        /// <param name="semester_code">Semester code ex F2011 for fall 2011</param>
        /// <returns>Grade book for the username for the requested semester</returns>
        public GradeBook getGradeBookById(String user_id, String semester_code)
        {
            GradeBook gradebook = new GradeBook();

            return gradebook;
        }

        /// <summary>
        /// Calculate the cumulative GPA for user_id
        /// </summary>
        /// <param name="user_id">Encrypted user id</param>
        /// <returns></returns>
        public float calculateOverallGPA(String user_id)
        {
            float gpa = 1.0f;

            return gpa;
        }

        /// <summary>
        /// Calculate the cumulative GPA for user_id
        /// </summary>
        /// <param name="user_id">Encrypted user id</param>
        /// <returns></returns>
        public float calculateSemsterGPA(String user_id, String semester_code)
        {
            float gpa = 1.0f;

            return gpa;
        }
    }
    
}
